<?php
namespace app\servermessage\logic;

use \app\manage\logic\BaseLogic;

/**
 * @author:      李颖
 * @DateTime:    2017-06-08 14:33:36
 * @Description: 站内信
 */
class MessageContent extends BaseLogic
{
	protected $name = 'message_content';
    protected $config = 'db_config_message';
    protected $messageModel = 'app\servermessage\model\MessageContent';
    protected $allowField = ['from_uid','title','content','type','orther_info','create_time','update_time'];

    /*发送站内信*/
    public function addContent($data): array 
    {
        is_array($data['orther_info']) && ($data['orther_info'] = json_encode($data['orther_info']));
    	$res = $this->model($this->messageModel)->allowField($this->allowField)->save($data);
    	$id = $this->model($this->messageModel)->id;
    	return auto_return($id, '发送站内信成功', '发送站内信失败');
    }




}